{extend name="base" /}
{block name="content"}
<div class="g-main">
    <div class="m-main-title">
        <div class="m-container-fluid">
            <a href="{:url('index/welcome')}"><i class="icon icon-home"></i>首页</a>
            <span class="icon-angle-right"></span>
            <span>商城</span>
            <span class="icon-angle-right"></span>
            <span>商品管理</span>
            <span class="icon-angle-right"></span>
            <span>商品属性</span>
            <span class="icon-angle-right"></span>
            <span>{$info ? '编辑' : '添加'}属性</span>
            <a class="u-flush"><i class="icon-repeat"></i></a>
        </div>
    </div>
    <div class="m-main-content">
        <div class="m-container">
            <div class="m-form">
                <form class="layui-form" id="j_form">
                    <table class="m-table">
                        <thead>
                            <tr>
                                <th colspan="2">{$info ? '编辑' : '添加'}属性</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td width="15%"><label for="name">属性名称<em>*</em></label></td>
                                <td><input type="text" class="u-ipt u-ipt-long" name="name" id="name" placeholder="请输入属性名称" value="{$info.name}" /></td>
                            </tr>
                            <tr>
                                <td><label for="">输入方式</label></td>
                                <td>
                                    <input type="radio" name="show_type" lay-filter="show_type" value="1" title="输入框"{if condition="!$info || $info['show_type'] eq 1"} checked{/if} />
                                    <input type="radio" name="show_type" lay-filter="show_type" value="2" title="单选框"{if condition="$info && $info['show_type'] eq 2"} checked{/if} />
                                    <input type="radio" name="show_type" lay-filter="show_type" value="3" title="多选框"{if condition="$info && $info['show_type'] eq 3"} checked{/if} />
                                </td>
                            </tr>
                            <tr>
                                <td><label for="value">属性值</label></td>
                                <td><div class="m-textarea"><textarea name="value" class="u-tarea" id="value" placeholder="请输入属性值">{$info.value}</textarea><span>单选框、多选框的选项值每行一个</span></div></td>
                            </tr>
                            <tr>
                                <td><label for="list_order">排序</label></td>
                                <td><input type="text" class="u-ipt u-ipt-tiny" name="list_order" id="list_order" placeholder="请输入排序值" value="{$info.list_order|default=0}" /><span>值越大越排在前面</span></td>
                            </tr>
                        </tbody>
                    </table>
                    <div class="m-form-btn"><input type="hidden" name="id" value="{$info.id}"><button id="j_btn" class="u-btn">确定提交</button></div>
                </form>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="extrajs"}
{include file="public:upload"/}
{/block}